import {EntityId, PageQueryParams, KfTreeNode} from "kf-web-library";

export interface AreaPageQueryParams extends Partial<PageQueryParams> {
  searchText?: string;
  level?: string;
  parentId?: string;
}

export interface AreaTreeQueryParams {
  id?: string;
  maxLevel?: string;
  includeSelf?: boolean;
  selfAsRoot?: boolean;
}

export interface Area {
  id: EntityId;
  parentId?: EntityId;
  name: string;
  level: string;
  center?: string;
  provinceId: EntityId;
  cityId?: EntityId;
  districtId?: EntityId;
  streetId?: EntityId;
  villageId?: EntityId;
  createTime?: string;
  modifyTime?: string;
  deleted: boolean;
}

export interface Area_Summary {
  id: EntityId;
  name: string;
  level: string;
}

export interface Area_TreeNode extends Omit<Area, "name">, KfTreeNode {
  id: EntityId;
  parentsId?: string[];
  parentsName?: string[];
  children?: Area_TreeNode[];
}
